package com.tanhua.server.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.UserInfoApi;
import com.tanhua.dubbo.mapper.UserInfoMapper;
import com.tanhua.dubbo.pojo.UserInfo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoService {

    @DubboReference(version = "1.0.0")
    private UserInfoApi userInfoApi;
    @Autowired
    private UserInfoMapper userInfoMapper;

    /**
     * 根据userId在userinfo表中查询相关数据
     * @param userId
     * @return
     */
    public UserInfo queryUserInfoByUserId(Long userId) {

        return userInfoApi.queryByUserId(userId);
    }

    public List<UserInfo> queryUserInfoByUserIdList(List<Object> userIdList) {
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        return this.userInfoMapper.selectList(queryWrapper);
    }
}
